https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04
If you have not already setup a database, follow the link above for instructions. Otherwise, log in to phpmyadmin and setup a database for the wordpress install.
cd ~
wget http://wordpress.org/latest.tar.gz
extract the files:
tar xzvf latest.tar.gz
thi will create a directory called wordpress in the home directory.
sudo apt-get install php5-gd libssh2-php
cd ~/wordpress
cp wp-config-sample.php wp-config.php
nano wp-config.php
fille in the values for ‘DB_NAME', ‘DB_USER' and ‘DB_PASSORD'
After you close the file, copy the files to the document root:
sudo rsync -avP ~/wordpress/ /var/www/html/
… or create another directory after /html/ to copy files to a subdirectory. Example:
sudo mkdir /var/www/html/home
then:
sudo rsync -avP ~/wordpress/ /var/www/html/home/
move into the directory:
cd /var/www/html/home
change ownership properties, where user below is the user:
sudo chown -R user:www-data *
manually create the uploads folder beneath the wp-content directory:
mkdir /var/www/html/home/wp-content/uploads
sudo chown -R :www-data /var/www/html/home/wp-content/uploads
Now you can complete the installation by going to the ip address of the install…
http://server_dmain_name_or_IP
After wordpress is installed, we modify apache to allow URL rewrites:
sudo nano /etc/apache2/sites-available/000-default.conf
here we set the ServerName and create a directory section where we allow overrides:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName server_domain_name_or_IP
<Directory /var/www/html/>
AllowOverride All
</Directory>
. . .
sudo a2enmod rewrite
sudo service apache2 restart
create an .htaccess file:
touch /var/www/html/home/.htaccess
sudo chown :www-data /var/www/html/home/.htaccess
chmod 664 /var/www/html/home/.htaccess
Now in wordpress settings, we can got to ‘Settngs' > ‘Permalinks' and choose settings as necessary